import request from "@/utils/request";

export function getRoutes() {
    return request({
        url: "/vue-element-admin/routes",
        method: "get",
    });
}

// 角色列表
export function getRoles() {
    return request({
        url: "/api/role/selectAll",
        method: "get",
    });
}

export function addRole(data) {
    return request({
        url: "/api/role/insert",
        method: "post",
        data,
    });
}

export function updateRole(id, data) {
    return request({
        url: "/api/role/update",
        method: "put",
        data,
    });
}

export function deleteRole(params) {
    return request({
        url: `/api/role/delete`,
        method: "delete",
        params,
    });
}

export function selectPage(params) {
    return request({
        url: "/api/role/selectPage",
        method: "get",
        params,
    });
}
